import request from '@/utils/request'

// 查询档格列表
export function listGrid(query) {
  return request({
    url: '/clothesCabinet/grid/list',
    method: 'get',
    params: query
  })
}

// 查询档格详细
export function getCabinetGrid(id) {
  return request({
    url: '/clothesCabinet/grid/' + id,
    method: 'get'
  })
}

// 新增档格
export function addGrid(data) {
  return request({
    url: '/clothesCabinet/grid/add',
    method: 'post',
    data: data
  })
}

// 修改档格
export function updateGrid(data) {
  return request({
    url: '/clothesCabinet/grid/edit',
    method: 'put',
    data: data
  })
}

// 删除档格
export function delGrid(id) {
  return request({
    url: '/clothesCabinet/grid/remove/' + id,
    method: 'delete'
  })
}

// 导出档格
export function exportGrid(query) {
  return request({
    url: '/clothesCabinet/grid/export',
    method: 'get',
    params: query
  })
}

// 修改档格
export function updateGrids(data) {
  return request({
    url: '/clothesCabinet/grid/updateGrids',
    method: 'put',
    data: data
  })
}

// 开门
export function openGrid(id) {
  return request({
    url: '/clothesCabinet/grid/open/' + id,
    method: 'get'
  })
}
